<extend name="Public/common"/>
<block name="othercss"> 
    <link href="{$theme_path}/css/slick.css" rel="stylesheet">
    <script src="{$theme_path}/js/slick.min.js"></script>
	  <script src="__PUBLIC__/common/validate/jquery.validate-1.13.1.js"></script>
  <script src="__PUBLIC__/common/layer/layer.js?v=20182145212"></script>
  <script type="text/javascript">
    fwshop_root = "__APP__";
    var theme_path = "{$theme_path}";//主题路径
    var url_login_back = "{:U('Register/login')}?ret="+document.location;
    var url_register_back = "{:U('Register/index')}?ret="+document.location;
    var url_top_login = "{:U('Register/top_state')}";//获取用户登陆状态地址
    var url_logout_ajax =  "{:U('Register/logout_ajax')}";//用户退出登陆地址AJAX
    var url_logout =  "{:U('Register/logout')}";//用户退出登陆地址
    var url_cart = "{:U('Cart/index')}";//购物车地址
    var url_add_cart = "{:U('Cart/add_cart')}";//加入购物车地址
    var url_help = "{:U('Help/index')}";//帮助中心地址
    var url_cart_num_count = "{:U('Cart/num_count')}";//获取购物车数量地址
	 var url_msg_num_count = "{:U('Ajax/message_count')}";//获取购物车数量地址
    var url_go_index = "{:U('/')}";//首页
    var url_top_search = "{:U('GList/index')}?"; //搜索地址
    var url_verify_code = "{:U('Register/verify')}?"; //获取验证码地址
    var url_forget_email = "{:U('Register/forget_email')}?"; //找回密码确定地址
    var url_forget_reset_ajax = "{:U('Register/forget_reset_ajax')}?"; //重置密码-找回密码确定地址
    var url_login = "{:U('Register/login')}?"; //用户登陆页面地址
    var url_login_submit = "{:U('Register/login_submit')}";//用户登陆请求地址
    var url_register_submit = "{:U('Register/register_submit')}";//用户注册请求地址
    //get_top_login_state();//获取顶部登陆状态
</script>
</block>
<block name="header">
<div class="header">
    <div class="clearfix box">
        <!--<a class="save">保存</a>-->
        <a class="return" href="javascript:history.back(-1)"><i class="return-icon"></i></a>
        <h2 style="font-weight: normal">{$goods.goods_name}</h2>
    </div>
</div>
</block>
<block name="body">
<div class="container pt50">
    <!--产品-->
    <div class="pro_cell">
        <div class="banner">
           <foreach name="goods.arr_picture_list" item="pic" >
            <a><img src="__ROOT__{$pic}" width="100%"/> </a>
           </foreach>
        </div>
        <div class="pro1 clearfix">
            <div class="right {:$isfav>0?'on':''}" onclick="add_fav()" id="goods_fav">
                <img src="{$theme_path}/images/car3.png" width="20"/>
                <img src="{$theme_path}/images/car3-on.png" width="20"/>
            </div>
            <div class="left">{$goods.goods_name} <br /><span style="font-size: 12px;color: #dd2727;">{$goods.cuxiao_msg}</span>
            </div>
        </div>
        <div class="pro2 clearfix">
            <div class="right">销量<span style="color: #dd2727;margin-left: 5px">{$sell_num}</span></div>
            <div class="left">¥
                <label id="data_price2">
                    {$goods.price}
                </label>
                <span class="yj">¥
                    <label id="data_price_market2">{$goods.price_market}</label>
                </span>
            </div>
            <notempty  name="status">
                <div>
                    <span style="font-size: 5px;">可获得 ¥ {$share}</span>
                </div>
            </notempty >
        </div>
    </div>
    <!--产品详情-->
    <div class="pro3">
        <div class="pro_cell_nav clearfix">
            <a class="on">产品详情</a>
            <a>评价</a>
            <a>热销产品</a>
        </div>
    </div>
    <ul class="pro_select">
        <li class="on">
            <div class="editor">
			{$goods.detail3|htmldecode}
			</div>
            <div class="editor">
              {$goods.detail|htmldecode}
            </div>
        </li>
        <li style="background-color: rgb(244, 244, 244);">
            <div class="ljpj">累计评价 （{$count_comment}）</div><a name="3"></a>
            <!--liuyan-->
            <div class="liuyansum">
                <ul>
				 <volist name="comment_list" id="item">
                    <li class="clearfix">
                        <div class="lans">
                            <div class="h1">{$item.member_name}</div>
                            <div class="h2">{$item.create_time|stringtime=3}</div>
                            <div class="h3">
                                {$item.detail|trim_textarea}
                            </div>
							  <if condition="$item['reply_detail'] neq ''">
							   <div class="h4">
                                {$item.reply_detail|trim_textarea}
                            </div>
							</if>
                        </div>
                        <div class="imgs"><img src="__ROOT__{$item.headpic}" width="100%">
                        </div>
                    </li>
					</volist>
                     
                </ul>
            </div>
            <div class="pagetion">
             {$comment_page}
            </div>
        </li>
        <li>
            <ul class="index_list">
			 <foreach name="hot_list" item="hot_item">
                <li>
                    <a href="{:U('Goods/index',array('id'=>$hot_item['goods_id']))}">
                        <img src="__ROOT__{$hot_item.picture}" width="100%">
                        <div class="ones">{$hot_item.goods_name}</div>
                        <div class="tags ones">
                            <span>{$hot_item.cuxiao_msg}</span>
                           
                        </div>
                    </a>
                    <div class="clearfix">
                        <a href="{:U('Goods/index',array('id'=>$hot_item['goods_id']))}" class="car_icon">
                            <img src="{$theme_path}/images/i_icon13.png">
                        </a>
                        <a href="{:U('Goods/index',array('id'=>$hot_item['goods_id']))}" class="price">￥{$hot_item.price}</a>
                    </div>
                </li>
			 </foreach>
              

            </ul>
        </li>
    </ul>
</div>
</block>

<block name="footer">
<div class="footer">
    <div class="pro-footer clearfix">
        <a class="car" style="color: #666" href="{$root_path}">
            <img src="{$theme_path}/images/f_icon1_off.png"/>首页
        </a>
        <a class="car" style="color: #666" href="{:urlrotue('Cart/index')}">
            <img src="{$theme_path}/images/f_icon3_off.png"/>购物车
            <span class="snumber">{$cart_count}</span>
        </a>
        <a class="car">
            <img src="{$theme_path}/images/f_icon5_on.png"/>客服
        </a>
        <div class="gotobuy">
        <a class="join">加入购物车</a>
        <a class="buy" >立即购买</a>
        </div>
    </div>
</div>

<div class="bg-black"></div>
<div class="fixed_add">
    <div class="clearfix top">
        <div class="closes" id="close"></div>
        <div class="lans clearfix">
            <dl>
                <dt>促销价</dt>
                <dd class="h1">¥ <label id="data_price">{$goods.price}</label> </dd>
            </dl>
            <dl>
                <dt>原价</dt>
                <dd>¥ <label id="data_price_market">{$goods.price_market}</label> </dd>
            </dl>
        </div>
        <img src="__ROOT__{$goods['arr_picture_list'][0]}" id="select_picture" width="100%"/>
    </div>
    <div class="bottom">
	    <foreach name="arr_par" item="par">
		   <if condition="$par['name'] eq '颜色'">
        <dl  class="clearfix" id="colors">
            <dd>
                <ul class="spec_list"  id="spec_list_{$par.id}" attr_t="{$par.name}">
				 <foreach name="par.sub" item="arr_par_sub">
				  <if condition="$arr_sel[$par['id']] eq $arr_par_sub">
                    <li class="sel"  onclick="select_spec(this)" attr_val="{$arr_par_sub}" attr_id="{$par.id}" title="{$arr_par_sub}">
                        <img src="__ROOT__{$goods.goods_id|get_pro_color_pic=$arr_par_sub}"width="50"/>
                    </li>
					<else/>
				<li onclick="select_spec(this)" attr_val="{$arr_par_sub}" attr_id="{$par.id}" title="{$arr_par_sub}">
                        <img src="__ROOT__{$goods.goods_id|get_pro_color_pic=$arr_par_sub}"width="50"/>
                    </li>
					</if>
					
					 </foreach>
                    
                </ul>
            </dd>
            <dt>颜色分类</dt>
        </dl>
		<else/>
        <dl  class="clearfix">
            <dd>
                <ul class="spec_list"  id="spec_list_{$par.id}" attr_t="{$par.name}">
				 <foreach name="par.sub" item="arr_par_sub">
                    <li <if condition="$arr_sel[$par['id']] eq $arr_par_sub">class="sel"</if> onclick="select_spec(this)" attr_val="{$arr_par_sub}" attr_id="{$par.id}">
                        {$arr_par_sub}
                    </li>
                 </foreach>
                </ul>
            </dd>
            <dt>{$par.name}</dt>
        </dl>
		</if>
		</foreach>
		 <input type="hidden" name="goods_id" id="goods_id" value="{$goods.goods_id}" />
              <input type="hidden" name="count_arr_par" id="count_arr_par" value="{$arr_par|count}" />
              <input type="hidden" name="item_id" id="item_id" value="{$item_id}" />
              <input type="hidden" name="hide_store_num" id="hide_store_num" value="{$goods.store_num}" />
        <dl  class="clearfix">
            <dd>
                <div class="addnumber clearfix">
                    <span  id="btn_jian_num"  data-qisale="{$goods.qi_sale}">-</span>
                    <input id="num" name="num" class="number" value="{$goods.qi_sale}"  onblur="edit_num({$goods.qi_sale})" onkeyup="this.value=this.value.replace(/\D/g,'')"  />
                    <span  id="btn_jia_num">+</span>
                </div>库存<span id="data_store_num">{$goods.store_num}</span>件
            </dd>
            <dt>数量</dt>
        </dl>
    </div>
     <div class="okbuy">
    <a class="yes" onclick="add_cart()">确 定</a>
    <a class="yes" onclick="check_cart()">确 定</a>
    </div>
    
</div>
</block>

<block name="otherjs">
<script>
    $('.banner').slick({
        pauseHove: false,
        infinite: true,
        arrows: false,
        dots: false,
        speed: 300,
        autoplay: true,
    });
    // 切换评价与详情
    $('.pro_cell_nav a').click(function () {
        $(this).addClass('on').siblings('a').removeClass('on');
        console.log($(this).index())
        $('.pro_select>li').removeClass('on');
        $('.pro_select>li').eq($(this).index()).addClass('on');
    })
	<if condition="$p gt 0">
	 $('.pro_select>li').removeClass('on');
	 $('.pro_cell_nav a').removeClass('on');
	  $('.pro_cell_nav a').eq(1).addClass('on');
      $('.pro_select li').eq(1).addClass('on');
	  <else/>
 $('.pro_cell_nav a').removeClass('on');
	   $('.pro_select>li').removeClass('on');
      $('.pro_cell_nav a').eq(0).addClass('on');
      $('.pro_select li').eq(0).addClass('on');
	   </if>
	
	
	 /*
    // 弹出选择
    $('.join,.buy').click(function (e) {
        $('.bg-black').stop(true,true).fadeIn();
        $('.fixed_add').stop(true,true).fadeIn();
    })
	*/
	 $('.gotobuy a').on('click',function(){
	     var i = $(this).index();
	     $('.bg-black').stop(true,true).fadeIn();
	     $('.fixed_add').stop(true,true).fadeIn();
		 $('.okbuy a').eq(i).show().siblings('.okbuy a').hide();
	 })

    $('#close').click(function (e) {
        $('.bg-black').stop(true,true).fadeOut();
        $('.fixed_add').stop(true,true).fadeOut();
    })
	
	$('.spec_list li img').on('click',function(){
	   var src = $(this).attr('src');
	   $('#select_picture').attr('src',src);
	   
	})
	

</script>
  <link rel="stylesheet" type="text/css" href="__PUBLIC__/common/artDialog6/css/ui-dialog.css" />
  <script type="text/javascript" src="__PUBLIC__/common/artDialog6/dist/dialog-min.js"></script> 
  <script type="text/javascript">
            var goods_id = $("#goods_id").val();//商品ID
            var url_get_item = "{:U('Goods/get_item')}";//获取商品单件
            var url_add_cart = "{:U('Cart/add_cart')}";//加入购物车地址
            var url_add_fav = "{:U('Goods/add_fav')}";//商品收藏地址           
        </script> 
<script type="text/javascript" src="{$theme_path}/js/goods.js?20190408_1"></script> 
</block>